import React from 'react';

import BaseExecuter from '../common/BaseExecuter';
import Constants from '../../common/Constants';

import DataManager from '../../datas/DataManager';

export default class WorkHardExecuter extends BaseExecuter {
  execute(action) {
    switch (action.name) {
      case "WH_RequestPostsAction":
        this._requestPosts(action);
        break;
      case "WH_RequestRecommendAction":
        this._requestPosts(action);
        break;
      case "WH_RequestPaiHangBangAction":
        this._requestPaihangbangPosts(action);
        break;
      case "WH_RequestOfficialAction":
        this._requestOfficial(action);
        break;
      case "WH_RequestHuoJiangAction":
        this._requestHuojiangPosts(action);
        break;
      case "WH_CreatePostAction":
        this._createPost(action);
        break;
      case "WH_RequestOfficialPostsAction":
        this._createOfficialPost(action);
        break;
      case "WH_RequestCommentListAction":
        this._requestCommentList(action);
        break;
      case "WH_RequestVotecAction":
        this._requestVotecList(action);
        break;
      case "WH_RequestDepartmentAction":
        this._requestDepartmentList(action);
        break;
      case "WH_RequestContentAction":
        this._requestContent(action);
        break;
      case "WH_SendCommentAction":
        this._sendComment(action);
        break;
      case "WH_SendSearchAction":
        this._sendSearch(action);
        break;
      case "WH_IdeasVoteAction":
        this._sendIdeasVote(action);
        break; 
      default:
    }
  }

  //http://47.93.168.211:8080/dqapp/boards/1/posts/searched?key=11&page=11&page_size=10
  _sendSearch(action) {
    this._sendRequestCommon(action, "sendSearch");
  }

  _sendComment(action) {
    this._sendRequestCommon(action, "sendComment");
  }
  _sendIdeasVote(action) {
    this._sendRequestCommon(action, "sendIdeasVote");
  }
  _requestContent(action) {
    this._sendRequestCommonResponse(action, "requestContent");
  }

  _requestCommentList(action) {
    this._sendRequestCommonResponse(action, "requestComment");
  }

  _requestPosts(action) {
    this._sendRequestCommon(action, "requestPosts");
  }
  _requestPaihangbangPosts(action) {
    this._sendRequestCommon(action, "requestPaihangbang");
  }
  _requestVotecList(action){
    this._sendRequestCommon(action, "requestVotec");
  }
  _requestOfficial(action){
    this._sendRequestCommon(action, "requestOfficial");
  }
  _requestDepartmentList(action){
    this._sendRequestCommon(action, "requestDepartment");
  }
  _requestHuojiangPosts(action) {
    this._sendRequestCommon(action, "requesthuojiang");
  }
  _createPost(action) {
    this._sendRequestCommon(action, "createPost");
  }
  _createOfficialPost(action){
    this._sendRequestCommon(action, "createOfficialPost");
  }

  _getModuleType() {
    return Constants.MODULE_TYPE.WORK_HARD;
  }
}
